<%
# This takes a Picture object and converts it into a javascript
#draggable_element (in fact this is done for a colection of image #objects)
%>

<% @dragable_image = dragable_image %>

<% id ="image_#{dragable_image.id}" %>
<span onclick=<%= "Element.toggle('edit_image_#{dragable_image.id}')"%> class="dragable_image_element">

    <%=image_tag(url_for_file_column("dragable_image", "name", "thumb"), :class=>"images", :id => id) %>
    <span id=<%="edit_image_#{dragable_image.id}"%> style="display:none" >   
     <%=link_to 'Edit', :action=> 'edit_image', :id=> dragable_image.id%> 
    </span>
    
</span>
<%= draggable_element "image_#{dragable_image.id}", :revert => true %>